Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cancel rearm if parameter safety switch is otherwise turned back on #263

Merged
merged 1 commit into from
Oct 3, 2023

Conversation

anthonyfk
Copy link
Contributor

I've been making great use out of this component to automate some temperature / humidity control in my house and ran into a funny scenario. My automations will essentially turn off the safety switch, make their modifications, then rearm the switch manually. This mostly works just fine, but I was noticing spurious failures caused by the safety switch being enabled even though I just disabled it. I then checked the documentation to see that there was this rearm logic for 60 seconds... and my temperature and humidity sensors updated every 60 seconds....

So long story long, extra logging proved that since this rearm is unconditionally fired, the safety switch was (occasionally) being turned on again right between when I'd turn it off and edit a parameter or two. Quite the luck!

This change intends to fix that by keeping track of the rearm task and simply cancelling it if the switch has otherwise been rearmed.

(Note: This is the first pull request I've made in some time; apologies for any procedural errors.)

@anthonyfk anthonyfk marked this pull request as ready for review September 9, 2023 04:46
@PeteRager
Copy link
Owner

Thanks for the PR. Looks like a good improvement. I'll take a more detailed look later today. I recall there being some unit tests for parameter safety - let's see if they need to be changed or added to to test this case?

@PeteRager PeteRager changed the base branch from master to 2023_10_0_rearm October 3, 2023 15:29
@PeteRager PeteRager merged commit 946ac3c into PeteRager:2023_10_0_rearm Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants